package com.zxm.ex.hall.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zxm.ex.common.exception.BackendException;
import com.zxm.ex.common.vo.BaseResultVo;
import com.zxm.ex.hall.service.IHallService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 影厅服务模块
 */
@RestController
@RequestMapping("/halls")
public class HallController {
    @Autowired
    private IHallService iHallService;

    /**
     * 新增影片播放厅信息接口
     * @param hallVo
     * @return
     * @throws BackendException
     */
    @RequestMapping(value = "/hall:add", method = RequestMethod.POST)
    public BaseResultVo saveHall(@RequestBody HallVo hallVo) throws BackendException {
        iHallService.saveHall(hallVo);
        return BaseResultVo.success();
    }


    /**
     * 影片播放厅列表查询
     * @return
     * @throws BackendException
     */
    @RequestMapping(value = "", method = RequestMethod.GET)
    public BaseResultVo getFilmsByCinemaId(HallReqVo hallReqVo) throws BackendException {
        IPage<HallFilmsVo> page= iHallService.getFilmsByCinemaId(hallReqVo);
        return BaseResultVo.success(page);
    }


}
